import Vue from 'vue'
import {
  Button,
  NavBar,
  Icon,
  SwipeCell,
  Card,
  Toast,
  Form,
  Field,
  Popup,
  Area,
  Image as VanImage,
  Loading,
  Radio,
  RadioGroup,
  Notify,
  ActionSheet
} from 'vant'

Vue.use(Button)
Vue.use(NavBar)
Vue.use(Icon)
Vue.use(SwipeCell)
Vue.use(Card)
Vue.use(Toast)
Vue.use(Form)
Vue.use(Field)
Vue.use(Popup)
Vue.use(Area)
Vue.use(VanImage)
Vue.use(Loading)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(Notify)
Vue.use(ActionSheet)

Vue.prototype.__loadToast = function (message) {
  this.$toast.loading({
    duration: 0,
    message,
    forbidClick: true
  })
}
Vue.prototype.__successToast = function (message) {
  this.$toast.success({
    message
  })
}
Vue.prototype.__failToast = function (message) {
  this.$toast.fail({
    message
  })
}
